package ar.org.cfired.creditos.abm;

import java.util.HashMap;

public class FormularioSolapa extends Entidad{

	private int frm_id;
	private String frm_id_estado;
	private int ofi_id;
	private int seg_id;
	private String frm_perfil;
	private int frm_orden;
	private String frm_nombre;
	private String sol_nombre;
	private String OBJNAME_;
	private String NAME_;
	
	
	public void setFrmId (int frm_id) {
		this.frm_id = frm_id;
	}
	public int getFrmId() {
		return (this.frm_id);
	}

	public void setFrmIdEstado (String frm_id_estado) {
		if (frm_id_estado != null)
			this.frm_id_estado = frm_id_estado.substring(0, Math.min(50, frm_id_estado.length()));
		else
			this.frm_id_estado = new String();
	}
	public String getFrmIdEstado() {
		return (this.frm_id_estado);
	}

	public void setOfiId (int ofi_id) {
		this.ofi_id = ofi_id;
	}
	public int getOfiId() {
		return (this.ofi_id);
	}

	public void setSegId (int seg_id) {
		this.seg_id = seg_id;
	}
	public int getSegId() {
		return (this.seg_id);
	}

	public void setFrmPerfil (String frm_perfil) {
		if (frm_perfil != null)
			this.frm_perfil = frm_perfil.substring(0, Math.min(1, frm_perfil.length()));
		else
			this.frm_perfil = new String();
	}
	public String getFrmPerfil() {
		return (this.frm_perfil);
	}

	public void setFrmOrden (int frm_orden) {
		this.frm_orden = frm_orden;
	}
	public int getFrmOrden() {
		return (this.frm_orden);
	}

	public void setFrmNombre (String frm_nombre) {
		if (frm_nombre != null)
			this.frm_nombre = frm_nombre.substring(0, Math.min(255, frm_nombre.length()));
		else
			this.frm_nombre = new String();
	}
	public String getFrmNombre() {
		return (this.frm_nombre);
	}

	public void setSolNombre (String sol_nombre) {
		if (sol_nombre != null)
			this.sol_nombre = sol_nombre.substring(0, Math.min(255, sol_nombre.length()));
		else
			this.sol_nombre = new String();
	}
	public String getSolNombre() {
		return (this.sol_nombre);
	}

	public void setOBJNAME (String OBJNAME_) {
		if (OBJNAME_ != null)
			this.OBJNAME_ = OBJNAME_.substring(0, Math.min(255, OBJNAME_.length()));
		else
			this.OBJNAME_ = new String();
	}
	public String getOBJNAME() {
		return (this.OBJNAME_);
	}

	public void setNAME (String NAME_) {
		if (NAME_ != null)
			this.NAME_ = NAME_.substring(0, Math.min(255, NAME_.length()));
		else
			this.NAME_ = new String();
	}
	public String getNAME() {
		return (this.NAME_);
	}
	
	
	
	
	
	
	
	@Override
	public String getCriterioBusqueda2() {
		String busqueda = " from FormularioSolapa ";
		boolean filtro = false;
		//ArrayList a = new ArrayList();
		
		if(this.getFrmId() > 0){
			if(!filtro){
				busqueda += " where " + " frm_id = " + this.getFrmId();
			filtro = true;
			}
			else
				busqueda += " and " + " frm_id = " + this.getFrmId();
		}
		
		if(this.getFrmIdEstado() != null){
			if(!filtro){
				busqueda += " where " + " frm_id_estado = " + this.getFrmIdEstado();
			filtro = true;
			}
			else
				busqueda += " and " + " frm_id_estado = " + this.getFrmIdEstado();
		}
		if(this.getOfiId() > 0){
			if(!filtro){
				busqueda +=  " where " + "ofi_id = '" + this.getOfiId()+ "' ";
			filtro = true;
			}
			else
				busqueda +=  " and " + "ofi_id = '" + this.getOfiId()+ "' ";
		}	
		
		if(this.getSegId() > 0){
			if(!filtro){
				busqueda += " where " + "seg_id = " + this.getSegId();
			filtro = true;
			}
			else
				busqueda += " and " + "seg_id = " + this.getSegId();
		}
		
		if(this.getFrmPerfil() != null){
			if(!filtro){
				busqueda += " where " + "frm_perfil = " + this.getFrmPerfil();
			filtro = true;
			}
			else
				busqueda += " and " + "frm_perfil = " + this.getFrmPerfil();
		}
		
		if(this.getFrmOrden() > 0){
			if(!filtro){
				busqueda += " where " + "frm_orden = " + this.getFrmOrden();
			filtro = true;
			}
			else
				busqueda += " and " + "frm_orden = " + this.getFrmOrden();
		}
		
		if(this.getFrmNombre() != null){
			if(!filtro){
				busqueda += " where " + "frm_nombre = " + this.getFrmNombre();
			filtro = true;
			}
			else
				busqueda += " and " + "frm_nombre = " + this.getFrmNombre();
		}
		 
		if(this.getSolNombre() != null){
			if(!filtro){
				busqueda += " where " + "sol_nombre = " + this.getSolNombre();
			filtro = true;
			}
			else
				busqueda += " and " + "sol_nombre = " + this.getSolNombre();
		}
		

		if(this.getOBJNAME() != null){
			if(!filtro){
				busqueda += " where " + "OBJNAME_ = " + this.getOBJNAME();
			filtro = true;
			}
			else
				busqueda += " and " + "OBJNAME_ = " + this.getOBJNAME();
		}

		if(this.getNAME() != null){
			if(!filtro){
				busqueda += " where " + "NAME_ = " + this.getNAME();
			filtro = true;
			}
			else
				busqueda += " and " + "NAME_ = " + this.getNAME();
		}
	
		return  busqueda;
		}

	@Override
	public void setVariables(HashMap<String, Object> variables) {
		// TODO Auto-generated method stub
		
	}
	

}
